import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'  // Vuex 数据持久化 


Vue.use(Vuex)

export default new Vuex.Store({
  plugins:[createPersistedState() ],   // Vuex 数据持久化插件
  state: {
    cartNum:8,
    userinfo:null,
    city:null,  // 城市信息 
    cityList:[],
    allCinemas:[],
    goodList:[],
  },
  mutations: {
    changeUserinfo(state,payload){
      state.userinfo = payload
    },
    changeCity(state,payload){
      state.city = payload;
    },
    changecityList(state,payload){
      state.cityList = payload;
    },
    changeallCinemas(state,payload){
      state.allCinemas = payload;
    },
    changegoodList(state,payload){
      state.goodList = payload;
    },
    
  },
  actions: {
  },
  modules: {
  }
})
